home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / TeXsource / commontex / h / tokenstack < prev   
Encoding:
Text File  |  1988-04-08  |  2.3 KB  |  113 lines

  1. /*
  2.  *    Copyright 1986, 1987 Pat Joseph Monardo. All rights reserved.
  3.  *    Copying of this file is granted according to the provisions 
  4.  *    specified in the file COPYING which must accompany this file.
  5.  */
  6.  
  7.  
  8. /*
  9.  *        tokensta.h
  10.  */
  11.  
  12. typedef struct
  13. {
  14.     qword    state_field;
  15.     qword    index_field;
  16.     hword    start_field;
  17.     hword    loc_field;
  18.     hword    limit_field;
  19.     hword    name_field;
  20. }
  21.     input;
  22.  
  23. global    input    cur_input;
  24. global    input    input_stack[];
  25. global    ptr        input_ptr;
  26. global    ptr        max_in_stack;
  27.  
  28. #define    state            cur_input.state_field
  29. #define    index            cur_input.index_field
  30. #define    start            cur_input.start_field
  31. #define    loc                cur_input.loc_field
  32. #define    limit            cur_input.limit_field
  33. #define    name            cur_input.name_field
  34.  
  35. #define    MID_LINE        1
  36. #define    SKIP_BLANKS        (2 + MAX_CHAR_CODE)
  37. #define    NEW_LINE        (3 + MAX_CHAR_CODE + MAX_CHAR_CODE)
  38.  
  39. #define    terminal_input    (name == 0)
  40.  
  41. global    alpha_file    input_file[];
  42.  
  43. global    ptr        in_open;
  44. global    val        line;
  45. global    val        line_stack[];
  46.  
  47. #define    cur_file    input_file[index]
  48.  
  49. #define    TOKEN_LIST            0
  50. #define    param_start            limit
  51. #define    token_type            index
  52.  
  53. #define    PARAMETER            0
  54. #define    U_TEMPLATE            1
  55. #define    V_TEMPLATE            2
  56. #define    BACKED_UP            3
  57. #define    INSERTED            4
  58. #define    MACRO                5
  59. #define    OUTPUT_TEXT            6
  60. #define    EVERY_PAR_TEXT        7
  61. #define    EVERY_MATH_TEXT        8
  62. #define    EVERY_DISPLAY_TEXT    9
  63. #define    EVERY_HBOX_TEXT        10
  64. #define    EVERY_VBOX_TEXT        11
  65. #define    EVERY_JOB_TEXT        12
  66. #define    EVERY_CR_TEXT        13
  67. #define    MARK_TEXT            14
  68. #define    WRITE_TEXT            15
  69.  
  70. global    ptr        param_ptr;
  71. global    ptr        param_stack[];
  72. global    ptr        max_param_stack;
  73.  
  74. int    runaway();
  75. int    show_context();
  76.  
  77. global    val        align_state;
  78. global    ptr        base_ptr;
  79. global    ptr        def_ref;
  80. global    ptr        warning_index;
  81. global    int        scanner_status;
  82.  
  83. #define    SKIPPING        1
  84. #define    DEFINING        2
  85. #define    MATCHING        3
  86. #define    ALIGNING        4
  87. #define    ABSORBING        5
  88.  
  89. #define    set_trick_count() \
  90.     {first_count = tally; \
  91.     trick_count = tally + 1 + ERROR_LINE - HALF_ERROR_LINE; \
  92.     if (trick_count < ERROR_LINE) \
  93.         trick_count = ERROR_LINE;}
  94.  
  95. #define    magic_c()    set_trick_count()
  96.  
  97. int    push_input();
  98. int    pop_input();
  99.  
  100. int    begin_token_list();
  101. int    end_token_list();
  102.  
  103. #define    back_list(L)    begin_token_list(L, BACKED_UP)
  104. #define    ins_list(L)        begin_token_list(L, INSERTED)
  105.  
  106. int    back_input();
  107. int    back_error();
  108.  
  109. int    begin_file_reading();
  110. int    end_file_reading();
  111.  
  112. int    clear_for_error_prompt();
  113.